<!DOCTYPE html>
<html>
<head>
    <title>工装库存</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 84%;
            float: right;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.mapNo" @on-enter="query" placeholder="图号"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.type" @on-enter="query" placeholder="规格"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
<!--            <div class="buttons-group">-->
<!--                #if($shiro.hasPermission("sparestorepos:import"))-->
<!--                <Upload ref="uploadFile"-->
<!--                        action="../sparestorepos/import"-->
<!--                        :format="['xlsx','xls']"-->
<!--                        :before-upload="handleBeforeUploadExcel"-->
<!--                        :on-success="handleImportExcelSuccess" :on-error="handleImportExcelError"-->
<!--                        :on-format-error="handleExcelFormatError" class="sugon_upload_btn">-->
<!--                    <i-button type="error"><i class="fa fa-hand-o-down"></i>&nbsp;导入</i-button>-->
<!--                </Upload>-->
<!--                #end-->
<!--                #if($shiro.hasPermission("sparestorepos:exchange"))-->
<!--                <i-button type="info" @click="exchangeStorePos"><i class="fa fa-exchange"></i>&nbsp;工装移库</i-button>-->
<!--                #end-->
<!--                #if($shiro.hasPermission("sparestorepos:save"))-->
<!--                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>-->
<!--                #end-->
<!--                #if($shiro.hasPermission("sparestorepos:update"))-->
<!--                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>-->
<!--                #end-->
<!--                #if($shiro.hasPermission("sparestorepos:delete"))-->
<!--                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>-->
<!--                #end-->
<!--            </div>-->
        </Row>
        <div style="height: 100%;width: 15%;float:left;overflow: hidden">
            <p class="text-center" style="font-size: 15px;">仓库</p>
            <div id="storeLayer">
                <ul id="storeTree" class="ztree"></ul>
            </div>
        </div>
        <table id="jqGrid"></table>
    </div>
    <!-- 移库CARD -->
    <Card v-show="!showList">
        <i-form ref="formValidate" :model="spareStorePos" :rules="ruleValidate" :label-width="80">
            <Card :bordered="false" :dis-hover="true" :padding="10">
                <p slot="title">当前库位</p>
                <Row>
                    <i-col span="11">
                        <Form-item label="库房名称" prop="storeName">
                            <i-input v-model="spareStorePos.storeName" placeholder="库房名称" readonly/>
                        </Form-item>
                    </i-col>
                    <i-col span="11">
                        <Form-item label="库位" prop="postion">
                            <i-input v-model="spareStorePos.postion" placeholder="备件编码" readonly/>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="11">
                        <Form-item label="备件名称" prop="spareName">
                            <i-input v-model="spareStorePos.spareName" placeholder="备件名称" readonly/>
                        </Form-item>
                    </i-col>
                    <i-col span="11">
                        <Form-item label="备件编码" prop="spareCode">
                            <i-input v-model="spareStorePos.spareCode" placeholder="库存数" readonly/>
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <i-col span="11">
                        <Form-item label="库存数" prop="storeNum">
                            <i-input v-model="spareStorePos.storeNum" placeholder="库存数" readonly/>
                        </Form-item>
                    </i-col>
                    <i-col span="11">
                        <Form-item label="转移库存数" prop="exchangeNum">
                            <i-input v-model="spareStorePos.exchangeNum" placeholder="备件名称"/>
                        </Form-item>
                    </i-col>
                </Row>
                <i-hidden v-model="spareStorePos.id"/>
            </Card>
            <Card :bordered="false" :dis-hover="true" :padding="10">
                <p slot="title">目标库位</p>
                <Row>
                    <i-col span="11">
                        <Form-item label="入库仓库" prop="intStore">
                            <i-input v-model="spareStorePos.targetStoreId" v-show="false"></i-input>
                            <i-input v-model="spareStorePos.targetStoreName" placeholder="入库仓库" readonly icon="md-arrow-dropdown-circle" @on-click="getStoreHouse"></i-input>
                        </Form-item>
                    </i-col>
                    <i-col span="11" v-if="!showOther" offset="2">
                        <Form-item label="货位">
                            <i-select v-model="spareStorePos.targetId" style="width: 80%" >
                                <i-option v-for="storePos in storePosList" :value="storePos.id" :key="storePos.id">{{storePos.postion}} 库存：{{storePos.storeNum}}
                                </i-option>
                            </i-select>
                            <i-button type="info" @click="showLoc(0)" style="width: 15%">&nbsp;其它</i-button>
                        </Form-item>
                    </i-col>
                    <i-col span="11" v-else offset="2">
                        <Form-item label="新货位">
                            <i-input v-model="spareStorePos.targetPostion"  style="width: 80%"></i-input>
                            <i-button type="info" @click="showLoc(1)" style="width: 15%">&nbsp;选择</i-button>
                        </Form-item>
                    </i-col>
                </Row>
            </Card>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/> 返回</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>
<script src="${rc.contextPath}/js/tools/toolsstorepos.js?_${date.systemTime}"></script>
</body>
</html>
